<script setup lang="ts">
import { useRouter } from "vue-router";
import { ref } from "vue";

const router = useRouter();
let title = ref("伙伴匹配");
router.beforeEach((to, from, next) => {
  title.value = to.meta.title;
  next();
});
</script>

<template>
  <van-nav-bar
    fixed
    :title="title"
    left-text="返回"
    left-arrow
    @click-left="router.back()"
    @click-right="router.push('/search')"
  >
    <template #right>
      <van-icon name="search" size="18" />
    </template>
  </van-nav-bar>
  <div id="content" style="padding: 50px 0">
    <router-view />
    <!--    <template v-if="active === 'home'">
          <Home />
        </template>
        <template v-if="active === 'team'">
          <Team />
        </template>-->
  </div>
  <van-tabbar route>
    <van-tabbar-item to="/home" icon="home-o" name="home">主页</van-tabbar-item>
    <van-tabbar-item to="/team" icon="search" name="team">队伍</van-tabbar-item>
    <van-tabbar-item to="/user" icon="friends-o" name="user"
      >个人
    </van-tabbar-item>
  </van-tabbar>
</template>

<style scoped></style>
